package SymbolTable;

import antlr.collections.AST;

//////////////////////////////////////////////////////////////////////////
//// STEntry
/**   Ta faltando colocar uma entrada pra line ...

@author Ivan Jeukens
@version v 0.1 03/10/2001
*/
public class STEntry {

    public static final int PRIVATE = 1;
    public static final int PUBLIC = 2;
    public static final int PROTECTED = 3;
    public static final int PACKAGE = 4;
    public static final int LOCAL = 5;
    
    public STEntry(String name, int mode, AST node, int narray) {
        _name = name;
        _node = node;
        _mode = mode;
        _narray = narray;
    }

    ///////////////////////////////////////////////////////////////////
    ////                        public methods                     ////

    public String toString() {        
        return new String("#STEntry " + _name + " mode=" + _mode +
            " nArray= " + _narray + " type = " + _type);
    }
    
    public int getMode() {
        return _mode;   
    }

    public String getName() {
        return _name;
    }            

    public boolean isArray() {
        return (_narray > 0);
    }
    
    public int getNarray() {
        return _narray;
    }
    
    public AST getNode() {
        return _node;   
    }
    
    public void setType(Class c) {
        _type = c;
    }

    public Class getType() {
        return _type;
    }
    
    ///////////////////////////////////////////////////////////////////
    ////                        private variables                  ////

    protected AST _node;
    protected String _name;
    protected int _mode;

    // dimensao do array
    protected int _narray;
    
    protected Class _type;
}
